from datetime import datetime,timedelta

import time

now=datetime.now()

time.sleep(5)

if now-datetime.now() < timedelta(seconds=10):
    print('成功执行了！')
print('失败了')